/**
 * 
 */
package neptune.web.server.operations;

import neptune.web.server.ApplicationManager;
import it.robertobifulco.ias.IncorrectParamsException;
import it.robertobifulco.ias.Operation;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 * 
 */
public class RemoveUserFromExperiment implements Operation {

	public static String ID = "RemoveUserFromExperiment";

	/*
	 * (non-Javadoc)
	 * 
	 * @see it.robertobifulco.ias.Operation#execute(java.lang.Object[])
	 */
	/**
	 * 
	 * @param args[0] =
	 *            String username
	 * @param args[1] =
	 *            String expId
	 */
	public Object[] execute(Object[] args) throws IncorrectParamsException,
			Exception {

		String username = (String) args[0];
		String expId = (String) args[1];

		ApplicationManager.getApplicationManager().getNeptuneManager()
				.getExperimentsRepository().deleteExperimentUser(expId,
						username);

		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see it.robertobifulco.ias.Operation#getDescription()
	 */
	public String getDescription() {
		return "Removes a given user from the given experiment";
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see it.robertobifulco.ias.Operation#getID()
	 */
	public String getID() {
		return ID;
	}

}
